
angular.module('app').directive('appHeadBar',[function () {
  return{
      restrict:'A',
      replace:'true',
      templateUrl:'view/template/headBar.html',
      scope:{
          text:'@'
      },
      link:function (scope) {
          scope.back = function () {
              window.history.back();
          };

          scope.$on('abc',function (event,data) {
              console.log(event,data);
          });//向下广播
          scope.$emit('cba',{name:2});//向上广播
      }
  }
}]);


